package src.com.foreknow.demo5;

import java.util.Scanner;

public class MethodDemo4 {
    public static void  sort(int num1,int num2,int num3){
        int temp = 0;
        if (num1>num2){
            temp = num1;
            num1 = num2;
            num2 = temp;
        }
        if (num2>num3){
            temp = num2;
            num2 = num3;
            num3 = temp;
        }
        if (num1>num2){
            temp = num1;
            num1 = num2;
            num2 = temp;
        }
        System.out.println("从小到大的输出为：" + num1 +"--"+ num2 +"--" +num3);

    }

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入第一个数：");
        int a = sc.nextInt();
        System.out.println("请输入第二个数：");
        int b = sc.nextInt();
        System.out.println("请输入第三个数：");
        int c = sc.nextInt();

        MethodDemo4.sort(a,b,c);

    }
}
